﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/HomeAdmin.Master" AutoEventWireup="true" CodeBehind="NewEmployee.aspx.cs" Inherits="DigitalAnts.Admin.Employee" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div align="center">
<asp:Label ID="lbltitle" runat="server" Text="" Font-Size="30px"></asp:Label>
<table>
    <tr>
        <td>&nbsp;</td>
        <td>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator7" 
                ControlToValidate="txtusername" runat="server" 
                ValidationExpression="^[\s\S]{1,49}$" Text="Username: 1-49 Ký Tự" 
                SetFocusOnError="true" Display="Dynamic" ValidationGroup="reg" /></td>
        <td align="center">
            &nbsp;</td>
        <td>
        </td>
        <td>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator6" 
                ControlToValidate="txtpassword" runat="server" 
                ValidationExpression="^[\s\S]{6,30}$" Text="Password: 6-30 Ký Tự" 
                SetFocusOnError="true" Display="Dynamic" ValidationGroup="reg" />
        </td>
    </tr>
    <tr>
        <td>Username</td>
        <td>
            <asp:TextBox ID="txtusername" runat="server" Width="150px"></asp:TextBox></td>
        <td align="left">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                                ControlToValidate="txtusername" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator></td>
        <td>Password</td>
        <td>
            <asp:TextBox ID="txtpassword" runat="server" TextMode="Password" Width="150px">
            </asp:TextBox></td>
        <td align="center">
                <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                                ControlToValidate="txtpassword" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator>--%>
        </td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>
                &nbsp;</td>
        <td align="center">
            &nbsp;</td>
        <td>
        </td>
        <td>
        <asp:RegularExpressionValidator ID="regPW0" runat="server" 
                                                    ControlToValidate="txtpassword" ErrorMessage="Password không đúng kiểu." 
                                                    SetFocusOnError="True" 
                                                    ValidationExpression="([a-zA-Z0-9]+([ ][a-zA-Z0-9]*)*){1,29}"></asp:RegularExpressionValidator>
        </td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator8" runat="server" 
                ControlToValidate="txtemail" Display="Dynamic" SetFocusOnError="true" 
                Text="Email: 9-30 Ký Tự" ValidationExpression="^[\s\S]{9,30}$" 
                ValidationGroup="reg" />
        </td>
        <td align="center">
                &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
                ControlToValidate="txtcellphone" Display="Dynamic" SetFocusOnError="true" 
                Text="CellPhone: 9-12 Ký Tự" ValidationExpression="^[\s\S]{9,12}$" ValidationGroup="reg" />
        </td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>Email</td>
        <td>
            <asp:TextBox ID="txtemail" runat="server" Width="150px"></asp:TextBox></td>
        <td align="left">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                                ControlToValidate="txtemail" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator>
        </td>
        <td>
            CellPhone</td>
        <td>
            <asp:TextBox ID="txtcellphone" runat="server" Width="150px"></asp:TextBox>
        </td>
        <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                                ControlToValidate="txtcellphone" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>
                <asp:RegularExpressionValidator ID="regEM2" runat="server" 
                                                    ControlToValidate="txtemail" ErrorMessage="Email không đúng kiểu." 
                                                    SetFocusOnError="True" ValidationGroup="txt"
                                                    ValidationExpression="^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$"></asp:RegularExpressionValidator>
        </td>
        <td align="center">
                &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
                
        </td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>
                </td>
        <td>
        </td>
        <td>
        </td>
        <td>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                ControlToValidate="txthomephone" Display="Dynamic" SetFocusOnError="true" 
                Text="HomePhone: 9-12 Ký Tự" ValidationExpression="^[\s\S]{9,12}$" 
                ValidationGroup="reg" />
        </td>
    </tr>
    <tr>
        <td>Avatar</td>
        <td>
            <asp:FileUpload ID="fulavatar" runat="server" Width="150px"/></td>
        <td> </td>
        <td>
            HomePhone</td>
        <td>
            <asp:TextBox ID="txthomephone" runat="server" Width="150px"></asp:TextBox>
        </td>
        <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                                                ControlToValidate="txthomephone" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator9" runat="server" 
                ControlToValidate="fulavatar" Display="Dynamic" 
                ErrorMessage="không đúng định dạng Avatar" 
                ValidationExpression="^([0-9a-zA-Z_\-~ :\\])+(.jpg|.JPG|.jpeg|.JPEG|.bmp|.BMP|.gif|.GIF|.png|.PNG)$" 
                ValidationGroup="txt">
                </asp:RegularExpressionValidator>
        </td>
        <td>&nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                ControlToValidate="txthomephone" ErrorMessage="HomePhone phải là số." 
                SetFocusOnError="True" ValidationExpression="^\d+$" ValidationGroup="txt"></asp:RegularExpressionValidator>
        </td>
        <td>
                &nbsp;</td>
    </tr>
    <tr>
        <td>Address</td>
        <td>
            <asp:TextBox ID="txtaddress" runat="server" Width="150px"></asp:TextBox></td>
        <td align="left">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                                ControlToValidate="txtaddress" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator></td>
        <td>
        </td>
        <td>
                
        </td>
    </tr>
    <tr>
        <td colspan="5" align="center">
            <asp:Label ID="lblmess" runat="server" Text="" ForeColor="Red"></asp:Label></td>
    </tr>
    <tr>
        <td colspan="5" align="center">
            <asp:Button ID="bttsave" runat="server" Text="Thêm" onclick="bttsave_Click" ValidationGroup="txt"/></td>
    </tr>
</table>
    <asp:GridView ID="gvEmployee" runat="server" CellPadding="4" 
        EnableModelValidation="True" ForeColor="#333333" GridLines="None" 
        AllowPaging="True" onpageindexchanging="gvEmployee_PageIndexChanging">
        <AlternatingRowStyle BackColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="colEmployeeID" 
                DataNavigateUrlFormatString="~\Admin\NewEmployee.aspx?EmployeeID={0}" 
                HeaderText="Edit" Text="Edit" />
        </Columns>
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="colEmployeeID" 
                DataNavigateUrlFormatString="~\Admin\ShowEmployee.aspx?EmployeeID={0}" 
                HeaderText="Show" Text="Show" />
        </Columns>
    </asp:GridView>
    <asp:HiddenField ID="hddavatar" runat="server" />
</div>
</asp:Content>
